#include <iostream>
using namespace std;

int main() {
    int a,b,c;
    cin >> a >> b >> c;
    int x = 2;
    int hit = 0;
    int xR,bR,cR;
    while (hit == 0)
    {    
        xR = a % x;
        bR = b % x;
        cR = c % x;
        if (xR == bR && bR == cR && cR == xR)
        {
            cout << x;
            hit = 1;
            continue;
        }
        x += 1;
    }
    
    return 0;
}